package conductores;

import java.util.ArrayList;
import java.util.List;
import aima.search.framework.SuccessorFunction;

public class SucesorConductores implements SuccessorFunction{

	@Override
	public List<Object> getSuccessors(Object state) {
		Board board = (Board) state;
	    ArrayList<Object> successors = new ArrayList<Object>();
	    //System.out.println("LLegan en hora"+board.llegadaEnHora()+" de tantos conductores "+ board.conductores.size());
	    
	    for(int condO=0; condO<board.getConductores().size(); condO++) {
	    	Conductor conductorOrigen =  board.getConductores().get(condO);
	    	for(IOperator operacion : Context.getInstance().getOperaciones()) {
		    	operacion.execute(board, condO, conductorOrigen, successors);
		    }
	    }
	    
	    return successors;
	}
}
